/*
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2023-12-03 22:53:39
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-03 15:34:50
 * @FilePath: \vue3_admin_template\project\src\api\user\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
//统一管理项目用户相关接口
import request from '@/utils/request'
//引入ts类型文件
import {
  loginFormData,
  loginResponseData,
  userInfoResponseData,
} from './type.ts'
//统一管理接口
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}

//对外暴露请求函数
//登录接口相关方法
export const reqLogin = (
  data: loginFormData, // console.log("111111111111111111",data)
) => request.post<any, loginResponseData>(API.LOGIN_URL, data)
//获取用户信息接口相关方法
export const reqUserInfo = () =>
  request.get<any, userInfoResponseData>(API.USERINFO_URL)
//退出登录
export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
